package cn.xiaohuodui.service;

import cn.xiaohuodui.dao.CollectMapper;
import cn.xiaohuodui.model.Collect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by TR on 2018/4/3.
 */
@Service
public class CollectService {

    @Autowired
    CollectMapper collectMapper;

    /**
     * 0:未关注  1:已关注
     * @param userId
     * @param vid
     * @return
     */
    public int hasCollect(Integer userId,Integer vid){
        Collect collect = collectMapper.hasCollect(userId, vid);
        if(collect!=null){
            return 1;
        }
        return 0;
    }
}
